-
-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(navigation): allow passing QueryBuilder or QueryBuilderParams in fetchNavigation
or <ContentNavigation>
#1206
Conversation
✅ Deploy Preview for nuxt-content ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful ❤️
Co-authored-by: Sébastien Chopin <[email protected]>
I love it as well! :) Thanks a lot @harlan-zw 😄 |
Hey @harlan-zw :) After a brief discussion with @farnabaz ; I remembered we had plans on supporting the same type of query format as I will still merge this PR after applying some changes as we want to support both: <script setup>
const queryBuilder = queryContent().where({ ... })
</script>
<template>
<ContentNavigation :query="queryBuilder" />
<!-- OR (upcoming) -->
<ContentNavigation :where="{ ... }" />
</template> |
Just added a test to cover your changes @harlan-zw, thank you again for this! |
query
prop to be QueryBuilder
instancefetchNavigation
or <ContentNavigation>
This would definitely be the ideal case, having all components with the same prop API for querying would be a great DX improvement. |
… `fetchNavigation` or `<ContentNavigation>` (#1206) Co-authored-by: Sébastien Chopin <[email protected]> Co-authored-by: Yaël Guilloux <[email protected]>
🔗 Linked issue
❓ Type of change
📚 Description
The
ContentNavigation
component is typed to only allow you to provide the query asQueryBuilderParams
. The DX of this isn't great as everywhere else in the doc aQueryBuilder
is used withqueryContent
.This is especially annoying when you want to show the
ContentNavigation
with a simple path prefix, as the user has to then figure out regex.The
fetchContentNavigation
already supports aQueryBuilder
, so it's seems like this was the initial expectation of this prop anyway.I've added an example to highlight the use case
📝 Checklist